<%-- 
    Document   : CreerStage
    Created on : 18 mars 2013, 21:21:20
    Author     : Fabien
--%>

<%@page import="com.myapp.bean.Etudiant"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>Creer stage secretariat</title>
        <link rel="stylesheet" href="JSP/style/style.css">
    </head>
    <body>
        <header><%@ include file="../headers/menuSecretariat.jsp"%></header>
        <div id="contenu">
            
            <form method="post" action="RecherchePromoCreerStageSe.do">
            <h2> Espace pour creer des stages </h2> <br>
            <h3> Selectionnez une promotion : </h3>
            <select name="promotion">
                <% ArrayList<Etudiant> listEtudiants = (ArrayList) request.getAttribute("listEtudiants");
                if(listEtudiants==null) { %>
                <option value="L3C" selected>L3C</option>
                <option value="M1C">M1C</option>
                <option value="M2C">M2C</option>
                <% } else if(listEtudiants.get(0).getNiveau()==4) { %>
                <option value="L3C">L3C</option>
                <option value="M1C" selected>M1C</option>
                <option value="M2C">M2C</option>
                 <% } else if(listEtudiants.get(0).getNiveau()==5) { %>
                 <option value="L3C">L3C</option>
                <option value="M1C">M1C</option>
                <option value="M2C" selected>M2C</option>
                <% } else { %>
                <option value="L3C" selected>L3C</option>
                <option value="M1C">M1C</option>
                <option value="M2C">M2C</option>
                <% } %>
            </select>
            <input type="submit" value="Valider" name="Valider" />
            </form>

            
                        <% 
                         if(request.getAttribute("listEtudiants")!=null) { %>
                          <table border=0>
                    <thead> <!-- En-tête du tableau -->
                        <tr>
                            <td>Nom</td>
                            <td>Prenom</td>
                            <td>Promotion</td>
                            <td></td>
                        </tr>
                    </thead>
                    <tbody>
                      <%   for (Etudiant e : listEtudiants) {%>
                      <form method="post" action="RecherchePromoCreerStageSe.do">
                        <tr>
                            <td> <%=e.getNom() %> </td>
                            <td> <%=e.getPrenom() %> </td>
                            <td><%=e.getTypeFormation() %></td>
                            <td><input type="submit" name="Créer stage" value="Créer stage"></td>
                        </tr> 
                         <input type="hidden" name="choix"/>
                         <input type="hidden" name="nCandidat" value="<%=e.getnCandidat()%>" />
                        </form>

                        <%}}%>

                    </tbody>
                </table>
            
        </div>
        <footer><%@ include file="../headers/Footer.jsp"%></footer>
    </body>
</html>
